package com.wehaicao.wehaicaoshardingjdbc.test.service;

import com.wehaicao.wehaicaoshardingjdbc.test.entity.Student;
import com.wehaicao.wehaicaoshardingjdbc.test.repository.StudentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentService {

    @Autowired
    private StudentRepository studentRepository ;


    public Student inserStudent(Student student){
        Student save = studentRepository.save(student);
        return save ;
    }

    public Student getById(String id){
        Student one = studentRepository.getOne(id);
        return  one ;
    }

}
